import React, { Component } from 'react';
import { Modal, Input, Col } from 'antd';
import tool from '../../utils/commonFuc'
const InputGroup = Input.Group;

// import './index.css'
class EditPasswordComponent extends Component {
    state = {
      password:''
    }
    showModal = () => {
      this.setState({
        visible: true,
      });
    }
    handleOk = (e) => {
      this.props.onHandleSubmit('edit',this.state.password);
    }
    handleCancel = () => {
      this.props.onHandleSubmit('close');
    }
    render() {
      const { password } = this.state;
      return (
        <div>
          <Modal title="修改密码" visible={this.props.editModalData.status}
            onOk={this.handleOk} onCancel={this.handleCancel}
          >
          <InputGroup>
            <Col span={3}>
              <span className="fl">新密码</span>
            </Col>
            <Col span={21}>
              <Input className="fl" value={ password } onChange={ (e) =>{ this.setState({password:tool.inputFilfter(e.target.value,1)}) } }/>
            </Col>  
          </InputGroup>                                  
          </Modal>
        </div>
      );
    }
}
export default EditPasswordComponent;